Gets the the text in a window
Public Const WM_GETTEXT = &HD
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
--
Dim strBuffer, lngRetVal, lngLength
--
lngLength = GetWindowTextLength(*)
strBuffer = String(lngLength + 1, " ")
lngRetVal = SendMessageByString(*, WM_GETTEXT, lngLength + 1, strBuffer)
strBuffer = Left(strBuffer, lngLength)
